{include file="index/header" /}
<body>
<form method="post" action="" id="listform">
  <div class="panel admin-panel">
    <div class="panel-head"><strong class="icon-reorder"> 内容列表</strong> <a href="" style="float:right; display:none;">添加字段</a></div>
    <div class="padding border-bottom">
      <ul class="search" style="padding-left:10px;">
        <li> <a class="button border-main icon-plus-square-o" href="{:url('add')}"> 添加内容</a> </li>
        <li>搜索：</li>
          <li>
            <select name="nav_id" class="input" style="width:150px; line-height:17px;" onchange="changeNav()"  id="nav">
              <option value="0">请选择课程</option>
              {foreach name='nav_data' item='nav'}
              <option value="{$nav.nav_id}" <?php if($nav['nav_id'] == $nav_id){echo 'selected';}?>>{$nav.nav_name}</option>
              {/foreach}
            </select>
          </li>
      </ul>
    </div>
    <table class="table table-hover text-center">
      <tr>
        <th>ID</th>
        <th>班级名称</th>
        <th>加入班级链接</th>
        <th>课程</th>
        <th>操作</th>
      </tr>
      {foreach name='data' item='v'}
        <tr>
          <td><input type="checkbox" name="class_id[]" value="{$v.class_id}" />
           {$v.class_id}</td>
          <td>{$v.class_name}</td>
          <td><input type="text" readonly="" class="input w100" value="https://www.itbaizhan.com{:url('index/classes/index',['id'=>$v.id])}" title="点击复制"></td>
          <td>{$v.nav_name}</td>
          <td><div class="button-group"> <a class="button border-main" href="{:url('teacher',['class_id' => $v['class_id'],'nav_id'=>$v['nav_id']])}"><span class="icon-edit"></span> 选择老师</a><a class="button border-main" href="{:url('group/add',['class_id' => $v['class_id']])}"><span class="icon-edit"></span> 设置组长</a> <a class="button border-main" href="{:url('edit',['class_id' => $v['class_id']])}"><span class="icon-edit"></span> 修改</a> <a class="button border-red" href="{:url('delete',['class_id' => $v['class_id']])}"  onclick="if(confirm('确定删除?')==false)return false;"><span class="icon-trash-o"></span> 删除</a> </div></td>
        </tr>
        {/foreach}
      <tr>
        <td colspan="5">{$data->render()}</td>
      </tr>
    </table>
  </div>
</form>
<script type="text/javascript">
  $(".w100").click(function(){ 
    $(this).select();
  });
  function changeNav(){
    $("#listform").submit();
}
</script>
</body>
</html>